{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Times New Roman;}{\f4\fswiss\fprq2\fcharset128 Microsoft Sans Serif;}{\f5\fswiss\fprq2\fcharset0 Arial Unicode MS;}{\f6\fnil\fprq2\fcharset0 MS Mincho;}{\f7\fnil\fprq0\fcharset0 Tahoma;}}
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
{\stylesheet{\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\snext1 Normal;}
{\s2\sb240\sa120\keepn\rtlch\af2\afs28\lang255\ltrch\dbch\af6\langfe255\hich\f2\fs28\lang1033\loch\f2\fs28\lang1033\sbasedon1\snext3 Heading;}
{\s3\sa120\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext3 Body Text;}
{\s4\sa120\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon3\snext4 List;}
{\s5\sb120\sa120\rtlch\af7\afs24\lang255\ai\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext5 caption;}
{\s6\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext6 Index;}
{\s7\sb120\sa120\rtlch\afs24\lang255\ai\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext7 caption;}
}
{\info{\creatim\yr2011\mo7\dy19\hr6\min24}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3000}}\deftab709
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}}
{\*\pgdscno0}\paperh15840\paperw12240\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\f4\fs20\lang1033\loch\f4\fs20\lang1033{\rtlch \ltrch\loch\f4\fs20\lang1033\i0\b0\rtlch\rtlch using Tesla.Core;}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\f4\fs20\lang1033\loch\f4\fs20\lang1033 {\rtlch \ltrch\loch\f4\fs20\lang1033\i0\b0 using Tesla.Math;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs20\lang1033\i0\b0 using Tesla.Scene;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs20\lang1033\i0\b0 using Tesla.Scene.Shape;}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\f4\fs20\lang1033\loch\f4\fs20\lang1033 {\rtlch \ltrch\loch\f4\fs20\lang1033\i0\b0 namespace TeslaSamples.Scene \{}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 [AppDescription("Spatial Controllers", PlatformCapabilities.XNA4 | PlatformCapabilities.Direct3D10, "ControllerImage", "ControllerDesc", "ControllerSource")]}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 public class ControllerSample : BasicApp \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 protected override void LoadContent() \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 Window.Title = "Spatial Controller Sample";}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Create a box with a simple color material}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 Box box = new Box("MyBox", 20, 20, 20);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 box.Material = ContentManager.Load<Material>("LitBasicColor.tem");}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 box.Material.SetParameter("MatDiffuse", Color.Crimson.ToVector3());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Set the custom controller to the box, this will get updated everytime the scene graph is updated.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 box.AddController(new RotateScaleController(.5f, new Vector2(.2f, 3), 45, Vector3.Up));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 RootNode.AddChild(box);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 /// <summary>}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 /// Custom controller, every time the Spatial it is attached to }
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 /// is updated, this controller will scale and rotate the Spatial}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 /// unless if it's disabled.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 /// </summary>}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 private class RotateScaleController : ISpatialController \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 private bool _enabled;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 private float _scale;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 private float _scaleIncrement;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 private Vector2 _scaleLimits;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 private float _angle;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 private float _rotIncrement;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 private Vector3 _rotAxis;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 public bool IsEnabled \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 get \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 return _enabled;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 set \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _enabled = value;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 /// <summary>}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 /// Creates a new instance of <see cref="RotateScaleController"/>.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 /// </summary>}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 /// <param name="scaleIncrement">The scale increment per-second.</param>}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 /// <param name="scaleLimits">The scale limits, X is min, Y is max.</param>}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 /// <param name="rotIncrement">The angle (in degrees) to rotate per-second</param>}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 /// <param name="rotAxis">The axis to rotate about</param>}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 public RotateScaleController(float scaleIncrement, Vector2 scaleLimits, float rotIncrement, Vector3 rotAxis) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _enabled = true;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _scale = 1.0f;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _scaleIncrement = scaleIncrement;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _scaleLimits = scaleLimits;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _angle = 0;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _rotIncrement = rotIncrement;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _rotAxis = rotAxis;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //After controllers are updated, a Spatial will}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //then check if its transforms, bounding volumes, or}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //lights have changed (and then update them). So computing}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //the scale/rotation here and setting them to the caller}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //will trigger a transform update after we execute.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 public void Update(GameTime time, Spatial caller) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 if(_enabled) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Incrememnt rotation angle (we interpolate this based on the}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //time since the last update/frame in order to animate smoothly)}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _angle += _rotIncrement * (float) time.ElapsedTimeInSeconds;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 if(_angle > 360) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _angle = 0;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 Quaternion q = Quaternion.FromAngleAxis(MathHelper.ToRadians(_angle), _rotAxis);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 caller.Rotation = q;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Increment scale, with the same idea}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _scale += _scaleIncrement * (float) time.ElapsedTimeInSeconds;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 //Check limits}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 if(_scale > _scaleLimits.Y) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _scaleIncrement *= -1;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _scale = _scaleLimits.Y;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \} else if(_scale < _scaleLimits.X) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _scaleIncrement *= -1;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 _scale = _scaleLimits.X;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 caller.SetScale(_scale);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f4\fs20\loch\f4\fs20 \}}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af5\langfe255\hich\f4\fs20\lang1033\loch\f4\fs20\lang1033 {\rtlch \ltrch\loch\f4\fs20\lang1033\i0\b0 \}}
\par }